<nav data-am-widget="menu" class="am-menu  am-menu-offcanvas1"
		data-am-menu-offcanvas>
		<a href="javascript: void(0)" class="am-menu-toggle"> <i
			class="am-menu-toggle-icon am-icon-bars am-icon-sm"></i>
		</a>
		<div class="am-offcanvas">
			<div class="am-offcanvas-bar">
				<ul class="am-menu-nav sm-block-grid-1">
					<li class="am-parent"><a href="##">科室</a>
						<ul class="am-menu-sub am-collapse  sm-block-grid-2 ">
							<#if department ??> <#list department as d>
							<li class=""><a
								href="javascript:showdeptinfo1('${d.dept_name}','${d.dept_address}','${d.dept_call}','${d.dept_doctor}')">${d.dept_name}</a>
							</li> </#list> </#if>
						</ul></li>
					<li class="am-parent"><a href="##">病房</a>
						<ul class="am-menu-sub am-collapse  sm-block-grid-3 ">
							<#if ward ??> <#list ward as w>
							<li class=""><a href="javascript:showdeptinfo2('${w.w_id}')">${w.w_id}</a>
							</li> </#list> </#if>
						</ul></li>
					<li class="am-parent"><a href="#c3">药品</a>
						<ul class="am-menu-sub am-collapse am-avg-sm-3">
							<li class=""><a>药名</a></li>
							<li class="" style="text-align: center"><a>单价（元）</a></li>
							<li class="" style="text-align: center"><a>库存量</a></li>
							<li class="" style="text-align: center">
								<hr>
							</li>
							<li class="" style="text-align: center">
								<hr>
							</li>
							<li class="" style="text-align: center">
								<hr width="80%" />
							</li> <#if drug ??> <#list drug as d>
							<li><a href="javascript:void(0)">${d.drug_name}</a></li>
							<li id="ddrugprice${d_index}" style="text-align: center"><a href="javascript:void(0)">${d.drug_price}</a></li>
							<li id="ddruginventory${d_index}"style="text-align: center"><a href="javascript:void(0)">${d.inventory }</a></li> </#list> </#if>
						</ul></li>
					<li class="am-parent"><a href="##">检验项目</a>
						<ul class="am-menu-sub am-collapse am-avg-sm-2">
							<li class=""><a>检验项目</a></li>
							<li class=""><a>价格（元）</a></li>
							<li class="" style="text-align: center">
								<hr>
							</li>
							<li class="" style="text-align: center">
								<hr width="55%" />
							</li> <#if item ??> <#list item as i>
							<li><a href="javascript:void(0)">${i.item_name}</a>
							<li id="iitemprice${i_index}"><a href="javascript:void(0)">${i.item_price}</a>
							</li> </#list> </#if>
						</ul></li>
					<li class=""><a href="javascript:showdeptinfo3()">作者</a></li>
				</ul>
			</div>
		</div>
	</nav>
	
	
		<div class="am-modal am-modal-no-btn" tabindex="-1" id="deptinfo1">
		<div class="am-modal-dialog" style="border-radius: 10px;">
			<div class="am-modal-hd">
				<h3>详细信息</h3>
				<a href="javascript: void(0)" class="am-close am-close-spin"
					data-am-modal-close>&times;</a>
			</div>
			<div id="dept1" class="am-modal-bd">
				<table
					class="am-table am-table-bordered am-table-radius am-table-striped">
					<thead>
						<tr>
							<th style="text-align: center">科室</th>
							<th style="text-align: center">地址</th>
							<th style="text-align: center">电话</th>
							<th style="text-align: center">主管医生</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td id="h1"></td>
							<td id="h2"></td>
							<td id="h3"></td>
							<td id="h4"></td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</div>
	
		<div class="am-modal am-modal-no-btn" tabindex="-1" id="deptinfo2">
		<div class="am-modal-dialog" style="border-radius: 10px;">
			<div class="am-modal-hd">
				<h3>详细信息</h3>
				<a href="javascript: void(0)" class="am-close am-close-spin"
					data-am-modal-close>&times;</a>
			</div>
			<div id="dept1" class="am-modal-bd">
				<table
					class="am-table am-table-bordered am-table-radius am-table-striped">
					<thead>
						<tr>
							<th style="text-align: center">病房号</th>
							<th style="text-align: center">病床号</th>
							<th style="text-align: center">所属科室</th>
							<th style="text-align: center">是否为空</th>
						</tr>
					</thead>
					<tbody id="wroom">
					</tbody>
				</table>
			</div>
		</div>
	</div>
	
	<div class="am-modal am-modal-no-btn" tabindex="-1" id="deptinfo3">
		<div class="am-modal-dialog" style="border-radius: 10px;">
			<div class="am-modal-hd">
				<h2>作者</h2>
				<a href="javascript: void(0)" class="am-close am-close-spin"
					data-am-modal-close>&times;</a>
			</div>
			<div class="am-modal-bd">
				<h5>施红宇&&陈璐瑶</h5>
			</div>
		</div>
	</div>
	
	<script>
	function showdeptinfo1(name, address, call, doctor) {
		$("#h1").html(name);
		$("#h2").html(address);
		$("#h3").html(call);
		$("#h4").html(doctor);
		$("#deptinfo1").modal('open');
	}

	function showdeptinfo2(id) {
		$("#wroom").html("");
		$.post('${ctx}/main/roominfo', {
			"id" : id
		}, function(data) {
			var len = data.data.length;
			for (var i = 0; i < len; i++) {
				$("#wroom").append(
						"<tr>" + "<td>" + data.data[i].W_ID + "</td>"
								+ "<td>" + data.data[i].BED_ID + "</td>"
								+ "<td>" + data.data[i].DEPT_NAME + "</td>"
								+ "<td>"
								+ (data.data[i].FLAG == 0 ? '无病人' : '有病人')
								+ "</td>" + "</tr>");
			}
			$("#deptinfo2").modal('open');
		}, 'json');

	}
	
	function showdeptinfo3(json) {
		$("#deptinfo3").modal('open');
	}
	</script>